home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / JInternalFrame$JDesktopIcon.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.5 KB  |  91 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Dimension;
  5. import java.io.IOException;
  6. import java.io.ObjectOutputStream;
  7. import javax.accessibility.Accessible;
  8. import javax.accessibility.AccessibleContext;
  9. import javax.swing.plaf.DesktopIconUI;
  10.  
  11. public class JInternalFrame$JDesktopIcon extends JComponent implements Accessible {
  12.    JInternalFrame internalFrame;
  13.  
  14.    public JInternalFrame$JDesktopIcon(JInternalFrame var1) {
  15.       this.setVisible(false);
  16.       this.setInternalFrame(var1);
  17.       this.updateUI();
  18.    }
  19.  
  20.    public DesktopIconUI getUI() {
  21.       return (DesktopIconUI)this.ui;
  22.    }
  23.  
  24.    public void setUI(DesktopIconUI var1) {
  25.       super.setUI(var1);
  26.    }
  27.  
  28.    public JInternalFrame getInternalFrame() {
  29.       return this.internalFrame;
  30.    }
  31.  
  32.    public void setInternalFrame(JInternalFrame var1) {
  33.       this.internalFrame = var1;
  34.    }
  35.  
  36.    public JDesktopPane getDesktopPane() {
  37.       return this.getInternalFrame() != null ? this.getInternalFrame().getDesktopPane() : null;
  38.    }
  39.  
  40.    public void updateUI() {
  41.       boolean var1 = this.ui != null;
  42.       this.setUI((DesktopIconUI)UIManager.getUI(this));
  43.       this.invalidate();
  44.       Dimension var2 = this.getPreferredSize();
  45.       this.setSize(var2.width, var2.height);
  46.       if (this.internalFrame != null && this.internalFrame.getUI() != null) {
  47.          SwingUtilities.updateComponentTreeUI(this.internalFrame);
  48.       }
  49.  
  50.    }
  51.  
  52.    void updateUIWhenHidden() {
  53.       this.setUI((DesktopIconUI)UIManager.getUI(this));
  54.       Dimension var1 = this.getPreferredSize();
  55.       this.setSize(var1.width, var1.height);
  56.       this.invalidate();
  57.       Component[] var2 = this.getComponents();
  58.       if (var2 != null) {
  59.          for(int var3 = 0; var3 < var2.length; ++var3) {
  60.             SwingUtilities.updateComponentTreeUI(var2[var3]);
  61.          }
  62.       }
  63.  
  64.    }
  65.  
  66.    public String getUIClassID() {
  67.       return "DesktopIconUI";
  68.    }
  69.  
  70.    private void writeObject(ObjectOutputStream var1) throws IOException {
  71.       var1.defaultWriteObject();
  72.       if (this.getUIClassID().equals("DesktopIconUI")) {
  73.          byte var2 = JComponent.getWriteObjCounter(this);
  74.          --var2;
  75.          JComponent.setWriteObjCounter(this, var2);
  76.          if (var2 == 0 && this.ui != null) {
  77.             this.ui.installUI(this);
  78.          }
  79.       }
  80.  
  81.    }
  82.  
  83.    public AccessibleContext getAccessibleContext() {
  84.       if (this.accessibleContext == null) {
  85.          this.accessibleContext = new JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon(this);
  86.       }
  87.  
  88.       return this.accessibleContext;
  89.    }
  90. }
  91.